import React , { Suspense,lazy }from 'react'
import {Route,Redirect,Switch} from 'react-router-dom'

import ROUTES from 'constants/routes'
import styled from './style.module.scss'

const Recommendation = lazy(()=>import('./Recommendation'))

const Discovery = ()=>{
  return (
    <div className={styled.root}>
      <Suspense fallback={null}>
        <Switch>
          <Route exact path={ROUTES.RECOMMENDATION} component={Recommendation}></Route>
          <Redirect from={`${ROUTES.DISCOVERY}`} to={ROUTES.RECOMMENDATION}></Redirect>
        </Switch>
      </Suspense>
     
    </div>
  )
}

export default Discovery